<?php
require_once ("includes/LoginCheck.php");

$uid = $_POST["uid"];
$passwd = $_POST["passwd"];

if ($uid) {
	$userinfo = check_auth($uid, $passwd);
	if($userinfo) {
		setcookie("uid", $userinfo['uid']);
		setcookie("passwd", $passwd);
		
		header("Location: /");
		exit;
	} else {
		$msg = "Error while login as <strong>$uid</strong>.";
	}
}
?>
